import * as echarts from 'echarts';
import ReactDOM from 'react-dom';
import React, { Component } from 'react';

class Index extends Component {
    componentDidMount() {
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('forms'));
        // 绘制图表
        myChart.setOption({   
            title: {
                text: '区域仓库容量'
            },
            tooltip: {},
            legend: {
                data:['存储量','入库量']
            },
            xAxis: {
                data: ["A区","B区","C区","D区","E区","F区","G区"]
            },
            yAxis: {
                // data: [20, 40, 60, 80, 100,]
            },
            series: [
                {
                name: '存储量',
                type: 'bar',
                data: [15, 20, 66, 10, 92, 20,0]
                },,
                {
                    name: '入库量',
                    type: 'line',
                    data: [15, 30, 46, 46, 46, 30, 0]
                }
            ]
        });
    }
    render() {
        return (
            <div id="forms" style={{width:'650px',height:'350px'}}></div>
        )
    }
}


export default Index;